﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using pwblog.Common;

namespace pwblog.Web
{
    public partial class contactus : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void SendContact(object sender, EventArgs e)
        {
            MailAssistant.SetupSender("ducnh3@gmail.com", "Duc123456");
            string subject = "IT News Feedback: " + tbSubject.Text.Trim();
            System.Text.StringBuilder sb = new System.Text.StringBuilder();
            sb.Append("From: " + tbName.Text.Trim());
            sb.Append("<br/>Email: " + tbEmail.Text.Trim());
            sb.Append("<br/>Nội dung liên hệ: <br/>");
            sb.Append("<div style='padding-left:15px; font-style:italic; color:grey; text-align:left'>\"");
            sb.Append(ckEditorContact.Text.Trim());
            sb.Append("\"");
            sb.Append("</div>");

            MailAssistant.SendMail(new String[] { "hoangduc17t@gmail.com" }, subject, sb.ToString(), null);
            Response.Redirect("contactsent.aspx");
        }
    }
}